<?php
include("../design/header.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" src="../scripts/rule.js"></script>
<title>Report</title>
<link rel="stylesheet" type="text/css" href="../design/main.css" />
</head>

<?php
	
	require_once("../../business/EngineParser.php");
	require_once("../../business/util/Utility.php");

	$param = $_POST["arrAlias"];
	$strQuery = $_POST["text_query"];
	$counter = $_POST["criteria_counter"];
	$arrData = 	getReportData($strQuery,$counter);
	

?>
<body>

<table id="mainTable" width="100%" class="mainTableHeight1024x768" border="0" cellpadding="0" cellspacing="0">
<tr>
    <td width="50" valign="top" class="LeftBgColor">&nbsp;<?php include("../design/leftMenu.php"); ?>
	</td>
    <td valign="top">
    
<table id="table1" name="table1" align="center" cellpadding="1" cellspacing="1" border="0" >
	<form id="form1" name="form1" method="post" action="">
   
    <tr>
    	<td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        
    </tr>
   
   
    <tr>
    	<td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        
    </tr>

    <tr>
    	<td colspan="6">&nbsp;</td>        
    </tr>

	<tr>
	   <?php
			$arr = getTokenizedArray($param[0],",");
			$size=sizeof($arr);
			for($i=0; $i<$size; $i++){
	   ?>
        <td class="TableHeader"><?=$arr[$i]?></td>
        
        <?php
        	}
		?>    
            
    </tr>

    	<?php
			$size = sizeof($arrData);

        	for($i=0; $i<$size;){
			
			?>
            	<tr>
            <?php
				for($j=0;$j<$counter;$j++){
					
					if($j%2==0){
						$class = "TableRowEven";		
					}else {
						$class = "TableRowOdd";		
					}
					
				?>
                <td class='<?=$class?>'><?=$arrData[$i]?></td>
                
                <?php
					$i++;
				}
				
				?>
                	</tr>
                <?php
			}
		?>
	
    
    
	</form>
</table>
    </td>
 </tr> 
 <tr>
 	<td>&nbsp;</td>
 </tr>  
 
 
</table>

</body>
</html>
